import * as utils from '../utils'

function createCourse02 (gl: WebGLRenderingContext) {
  gl.clearColor(0.0, 0.0, 0.0, 1.0)
  gl.clear(gl.COLOR_BUFFER_BIT)
  const vectexShaderSrc = `
    attribute vec4 a_Position;
      void main() {
          gl_Position = a_Position;
          gl_PointSize = 10.0;
      }
    `

  const fragmentShaderSrc = `
      void main() {
          gl_FragColor  = vec4(1.0, 0.0, 0.0, 1.0);
      }
    `
  const program = utils.initShaders(gl, vectexShaderSrc, fragmentShaderSrc)

  const aPosition = gl.getAttribLocation(program, 'a_Position')
  gl.vertexAttrib4f(aPosition, 0.5, 0.0, 0.0, 1.0)

  gl.drawArrays(gl.POINTS, 0, 1)
}

export {
  createCourse02
}
